const { resolve } = require("path");
const HtmlWebapckPlugins = require("html-webpack-plugin");

module.exports = {
  entry: { main: "./src/main.js", index: "./src/js/index.js" },
  output: {
    filename: "[name].js",
    path: resolve(__dirname, "dist"),
    library: "storage-free",
    libraryTarget: "umd",
    umdNamedDefine: true,
  },
  plugins: [
    new HtmlWebapckPlugins({
      template: "./public/index.html",
      chunks: ["index.js"],
    }),
  ],
  resolve: {
    alias: {
      "@": "src/*",
    },
    extensions: ["*", ".js", ".vue", ".json"],
  },
  devServer: {
    compress: true,
    open: true,
    hot: true,
    port: 3000,
  },
  mode: "production",
};
